package com.iplay.component.im;

import com.google.gson.Gson;

public interface IMComponent {

	boolean createUser(String username, String password) throws IMException;
	
	boolean deleteUser(String username) throws IMException;

	void sendMessage(String receiver, String message) throws IMException;

	default void sendObject(String receiver, Object message) throws IMException {
		Gson gson = new Gson();
		sendMessage(receiver, gson.toJson(message));
	}
	
	void sendMessage(String receiver, Message message) throws IMException;
	
	void sendMessage(OutgoingMessage message) throws IMException;
	
	void modifyUserPassword(String username, String password) throws IMException ;
}
